Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: update sbt-by-example #1153

Merged
merged 3 commits into from
Aug 12, 2023
Merged

Conversation

ckipp01
Copy link
Contributor

@ckipp01 ckipp01 commented Aug 4, 2023

I love this guide. I always recommend it to new people getting starting with sbt. The last couple times I did however they always came back to me ab out certain things not working anymore, mainly the console examples. I decided to just go through the whole thing myself and update all of the examples using a more modern sbt version and updating the output to match. There is also a couple other choices that I made while updating things like:

  • Changing the weather site we use as an example since it no longer is active
  • Changing the libraries being used from gigahorse to sttp and Play JSON to uJson. I didn't do this just because but rather to more align with the libraries that are being used by the scala toolkit. Hopefully people will be a bit more familiar with these as I don't assume a newcomer to Scala will be using gigahorse or really Play JSON unless they are using Play!. If this isn't ok, let me know and I can try to recreate it using the old libraries, but I think these examples are clearer.

@@ -211,35 +226,34 @@ sbt:Hello> ~testQuick

### Write a test

Leaving the previous command running, create a file named `src/test/scala/HelloSpec.scala`
Leaving the previous command running, create a file named `src/test/scala/example/HelloSpec.scala`
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tiny change, but I noticed it while going through this. Since we had the user create src/main/scala/example/ I thought it appropriate to also do the same for the test, which is more than likely going to be followed on their teams anyways.

@ckipp01
Copy link
Contributor Author

ckipp01 commented Aug 4, 2023

Running the ref/example-weather I get:

[info] + ref/example-weather [PENDING]
[error]  Pending test passed. Mark as passing to remove this failure.
[error] stack trace is suppressed; run last scripted for the full output
[error] (scripted) Failed tests:
[error]         ref/example-weather

I don't see any errors though when it runs so I don't fully get what is failing here or why this is marked PENDING? I actually haven't seen the pending file before, I've always just seen test, so I might totally be misunderstanding something here.

EDIT: Ah after seeing c170298 I'm assuming I can just rename this back to test now.

I love this guide. I always recommend it to new people getting starting
with sbt. The last couple times I did however they always came back to
me ab out certain things not working anymore, mainly the console
examples. I decided to just go through the whole thing myself and update
all of the examples using a more modern sbt version and updating the
output to match. There is also a couple other choices that I made while
updating things like:

- Changing the weather site we use as an example since it no longer is
  active
- Changing the libraries being used from gigahorse to sttp and Play JSON
  to uJson. I didn't do this _just because_ but rather to more align
  with the libraries that are being used by the scala toolkit. Hopefully
  people will be a bit more familiar with these as I don't assume a
  newcomer to Scala will be using gigahorse or really Play JSON _unless_
  they are using Play!. If this isn't ok, let me know and I can try to
  recreate it using the old libraries, but I think these examples are
  clearer.
@leifwickland
Copy link
Contributor

Thanks for doing this, @ckipp01!

@eed3si9n
Copy link
Member

eed3si9n commented Aug 5, 2023

Thanks for the contribution @ckipp01! I'm on vacation and I haven't had chance to look into the details yet.

@ckipp01
Copy link
Contributor Author

ckipp01 commented Aug 11, 2023

Alright, so I switched out the usages of explicit dependencies to instead use the toolkit and toolkit-test. This should be good for a review now!

@ckipp01 ckipp01 requested a review from eed3si9n August 11, 2023 13:17
Copy link
Member

@eed3si9n eed3si9n left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @ckipp01!

@eed3si9n eed3si9n merged commit fcd2ced into sbt:develop Aug 12, 2023
2 checks passed
@ckipp01 ckipp01 deleted the sbt-by-example branch August 12, 2023 07:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants